#include "mainwindow.h"
#include "databasemanager.h"
#include "logindialog.h"
#include <QApplication>
#include <QFile>



int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    DataBaseManager::instance();
    QFile styleFile(":/style/style.qss");
    if(styleFile.open(QFile::ReadOnly)){
        QString styleSheet=QString(styleFile.readAll());
        a.setStyleSheet(styleSheet);//应用样式表
        styleFile.close();
    }else{
        qWarning()<<"Failed to load stylesheet!";
    }
    LoginDialog loginDlg;
    if(loginDlg.exec()==QDialog::Accepted){
        MainWindow w;
        w.show();
        return a.exec();
    }
    return 0;
}
